@import (reference) '../../designer/form/variable.less';

@label-pad: 10px 9px;
@border-color: #d9d9d9;
@trans-time: .225s;
@img-h: 28px;
@item-pr: 5px;
@bg-color: rgb(230, 245, 255);
@img-item-h: 150px;

.wea-edc-upload-container {
  position: relative;
  .ant-progress{
    position: absolute;
    opacity: 0.5;
    z-index: 10;
    pointer-events: none;
  }
  .ant-progress-bg{
    border-radius: 0;
  }
  .ant-progress-inner{
    border-radius: 0;
    background: rgba(236,236,236,0);
  }
  .wea-edc-upload-inner{
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
  }
}

.wea-edc-drag-inner {
  padding: @label-pad;
  color: #666;
  font-size: 14px;
  border: 1px dashed @border-color;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  
  &.drag,
  &:hover {
    background: @bg-color;
  }
  & > div {
    display: table-cell;
    vertical-align: middle;
    line-height: 1.3;   
  }
  i {
    padding-right: 7px;
    font-weight: 700;
  }
}

.wea-edc-upload-item {
  position: relative;
  padding: 8px @item-pr;
  font-size: 14px;
  border: 1px solid @border-color;
  cursor: pointer;

  .wea-edc-upload-title {
    width: 100%;
    word-break: break-all;
  }
  & > div {
    display: table-cell;
    vertical-align: middle;
  }
  .has-error {
    color: @error-color;
    vertical-align: top;
  }
  &:hover {
    background: @bg-color;
  }
  img {
    width: @img-h;
    height: @img-h;
    margin-right: @item-pr;
    vertical-align: middle;
  }
  span {
    display: inline-block;
    vertical-align: middle;
  }
  .wea-edc-upload-acts {
    line-height: @img-h;

    i {
      font-size: 18px;
      color: @error-color;
      transition:  all ease-in @trans-time;
      cursor: pointer;
      vertical-align: middle;

      &:hover {
        opacity: .8;
      }
    }
  }
}

.wea-edc-upload-img {
  & > div{
    display: inline-block;
    vertical-align: top;
    margin: 0 7px 7px 0;
    width: @img-item-h;
    height: @img-item-h;
    border: 1px dashed @border-color;
  }
  .wea-edc-upload-inner{
    border: 1px solid @border-color;
  }
  .wea-edc-upload-item {
    padding: 0;

    img,
    .wea-edc-upload-file-img {
      display: block;
      width: 100%;
      height: 100%
    }
    img {
      margin: 0;
    }
    &:hover {
      border-color: @main-color;

      .wea-edc-upload-acts {
        display: block;
      }
    }
  }

  .wea-edc-upload-acts {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 2px 6px 6px;
    line-height: 1;
  }
  .wea-edc-upload-title {
    display: none;
  }
}
.wea-edc-upload-img-item,
.wea-edc-upload-img-content {
  position: relative;
  max-width: 100%;
  padding: 10px 0;
  background: #fff;
  overflow: hidden;
}

.wea-edc-upload-img-content {
  text-align: center;
  font-size: 14px;
  color: @font-color-normal;
  cursor: pointer;
  height: 100%;
  
  &:hover {
    border-color: @main-color;
    opacity: .8;
  }
  .img-placeholder {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 10px auto;
    background: url('/edc/images/formCom-picture.png') center no-repeat;
  }
  i {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 2px;
    font-size: 14px;
    border-radius: 50%;
    background-color: #fff;
    color: @main-color;
  }
}

.mobile-device {
  .wea-edc-drag-inner {
    padding: 12px 9px;

    & > div {
      font-size: 13px;
      color: @main-color;
    }
  }

  .wea-edc-upload-img {
    & > div {
      width: 30%;
      height: 27vw;
    }
    .wea-edc-upload-img-content{
      padding: 0;
      font-size: 12px;
      .img-placeholder {
        position: relative;
        width: 35px;
        height: 35px;
        margin: 10px auto;
        background: url(/edc/images/formCom-picture.png) center no-repeat;
        background-size: 35px;
      }
    }
  }
}

@media (hover: none) {
  .wea-edc-upload-item,
  .wea-edc-drag-inner {
    &:hover {
      background: inherit;
    }
  }
  .wea-edc-upload-img-content {
    &:hover {
      opacity: 1;
    }
  }
  .wea-edc-upload-img {
    .wea-edc-upload-item {
      &:hover {
        border-color: @border-color;
      }
    }
  }
}